home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / DHTML - Window and Frames / left-right-scrollling-window.izs < prev    next >
Text File  |  2005-09-02  |  3KB  |  122 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Left-Right scrolling window script
  4. <!/TITLE>
  5.  
  6. <!BROWSER>FF1+ IE5+ Opr7+<!/BROWSER>
  7.  
  8. <!DESCRIPTION>A scrolling window script that dynamically scrolls the window all the way from the left edge of the document to the right, then starts all over again. Use it on presentational pages to allow surfers to sit back and just enjoy the presentation!
  9. <!/DESCRIPTION> 
  10.  
  11. <!CATEGORY>window and frames<!/CATEGORY>
  12.  
  13. <!SCRIPT>
  14. <!-- START OF SCRIPT -->
  15. <script language="JavaScript1.2">
  16.  
  17. /*
  18. Left-Right scrolling window Script- ⌐ Dynamic Drive (www.dynamicdrive.com)
  19. For full source code, visit http://www.dynamicdrive.com/
  20. This credit MUST stay intact for use
  21. */
  22.  
  23. //change speed to another integer to alter the scrolling speed. Greater is faster
  24. var speed=2
  25. var currentpos=0,alt=1,curpos1=0,curpos2=-1
  26. function initialize(){
  27. startit()
  28. }
  29.  
  30. function iecompattest(){
  31. return (document.compatMode!="BackCompat")? document.documentElement : document.body
  32. }
  33.  
  34. function scrollwindow(){
  35. if (document.all)
  36. temp=iecompattest().scrollLeft
  37. else
  38. temp=window.pageXOffset
  39. if (alt==0)
  40. alt=1
  41. else
  42. alt=0
  43. if (alt==0)
  44. curpos1=temp
  45. else
  46. curpos2=temp
  47. if (curpos1!=curpos2){
  48. if (document.all)
  49. currentpos=iecompattest().scrollLeft+speed
  50. else
  51. currentpos=window.pageXOffset+speed
  52. window.scroll(currentpos,0)
  53. }
  54. else{
  55. currentpos=0
  56. window.scroll(currentpos,0)
  57. }
  58. }
  59. function startit(){
  60. setInterval("scrollwindow()",10)
  61. }
  62. window.onload=initialize
  63. </script>
  64. <!-- END OF SCRIPT -->
  65. <!/SCRIPT>
  66.  
  67. <!PREVIEW>
  68. <!-- START OF SCRIPT -->
  69.  
  70. <script language="JavaScript1.2">
  71.  
  72. /*
  73. Left-Right scrolling window Script- ⌐ Dynamic Drive (www.dynamicdrive.com)
  74. For full source code, visit http://www.dynamicdrive.com/
  75. This credit MUST stay intact for use
  76. */
  77.  
  78. //change speed to another integer to alter the scrolling speed. Greater is faster
  79. var speed=2
  80. var currentpos=0,alt=1,curpos1=0,curpos2=-1
  81. function initialize(){
  82. startit()
  83. }
  84.  
  85. function iecompattest(){
  86. return (document.compatMode!="BackCompat")? document.documentElement : document.body
  87. }
  88.  
  89. function scrollwindow(){
  90. if (document.all)
  91. temp=iecompattest().scrollLeft
  92. else
  93. temp=window.pageXOffset
  94. if (alt==0)
  95. alt=1
  96. else
  97. alt=0
  98. if (alt==0)
  99. curpos1=temp
  100. else
  101. curpos2=temp
  102. if (curpos1!=curpos2){
  103. if (document.all)
  104. currentpos=iecompattest().scrollLeft+speed
  105. else
  106. currentpos=window.pageXOffset+speed
  107. window.scroll(currentpos,0)
  108. }
  109. else{
  110. currentpos=0
  111. window.scroll(currentpos,0)
  112. }
  113. }
  114. function startit(){
  115. setInterval("scrollwindow()",10)
  116. }
  117. window.onload=initialize
  118. </script>
  119. <!-- END OF SCRIPT -->
  120. <!/PREVIEW>
  121.  
  122. <!RELATED>NONE<!/RELATED>